<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: lhr
  Date: 2022/5/12
  Time: 9:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<html>
  <head>
    <title>首页</title>
  </head>
  <body>
 <%-- &lt;%&ndash; 声明变量定义方法 &ndash;%&gt;
  <%!
    String mess = "";
    void sayHello(String name,String sex){
      if (sex.equals("男"))
        mess="你好!"+name+"先生";
        mess="你好!"+name+"女士";
    }
  %>
  &lt;%&ndash;调用方法&ndash;%&gt;
  <%
    sayHello("卓奕兮","女");
  %>
  <%=mess%>
  <a href="hello">后台Servlet</a>--%>

  <%--<c:if test="${17>=18}">
    <h2>你还是未成年人</h2>
  </c:if>
  <c:if test="${19>=18}">
    <h2>你是成年人</h2>
  </c:if>--%>
  <%--<%!
    String language = "java";
    String hy="";
    String checkLanguage(String lan){
      if (lan.equals("python")){
        return "人工智能";
      }else if(lan.equals("java")){
        return "企业级应用开发";
      }else{
        return "其他领域";
      }
    }
  %>
  <%
    hy = checkLanguage("python");
  %>
  适合的领域是:<% out.print(hy);%>
--%>
<%-- 使用response--%>
<%-- <%!
   String language = "java";
   String hy="";
   String checkLanguage(String lan){
     if (lan.equals("python")){
       return "人工智能";
     }else if(lan.equals("java")){
       return "企业级应用开发";
     }else{
       return "其他领域";
     }
   }
 %>
  <%
    hy = checkLanguage("php");
//    使用response 隐式对象实现请求的重定向动作
    if(hy.equals("人工智能")){
      response.sendRedirect("rgzn.jsp");
    }else if(hy.equals("企业级应用开发")){
      response.sendRedirect("qyjyykf.jsp");
    }else{
      response.sendRedirect("qtly.jsp");
    }
  %>--%>
  </body>
</html>
